package com.xmkj.winmoney.mine.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.common.retrofit.entity.bean.WashCarRecordBean;
import com.common.widget.recyclerview.refresh.adapter.CommonAdapter;
import com.common.widget.recyclerview.refresh.adapter.ViewHolder;
import com.xmkj.winmoney.R;
import com.xmkj.winmoney.activity.OrderDetalRecordActivitiy;

import java.util.List;

/**
 * Created by chen on 2018/3/31.
 */

public class WashRecordAdapter extends CommonAdapter<WashCarRecordBean.ListsBean> {
    public WashRecordAdapter(Context context, List<WashCarRecordBean.ListsBean> data) {
        super(context, data);
    }

    @Override
    protected void convert(ViewHolder holder, final WashCarRecordBean.ListsBean item, int position) {
        holder.setText(R.id.tv_car_name,item.brand+" "+item.model+" "+item.carnum);
        holder.setText(R.id.tv_wash_money,item.total);
        holder.setText(R.id.tv_date,item.create_time);
        holder.getParentView().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(mContext, OrderDetalRecordActivitiy.class);
                intent.putExtra(OrderDetalRecordActivitiy.ORDERID,item.id+"");
                mContext.startActivity(intent);
            }
        });
    }

    @Override
    protected int getItemViewLayoutId(int position, WashCarRecordBean.ListsBean item) {
        return R.layout.item_user_car_details;
    }
}
